Skip to content

refactor: migrate accessibility props to aria props#5005

Merged
satya164 merged 8 commits into
callstack:mainfrom
MrMuzyk:refactor/migrate-accessiblity-props-to-aria-props
Jun 23, 2026
Merged

refactor: migrate accessibility props to aria props#5005
satya164 merged 8 commits into
callstack:mainfrom
MrMuzyk:refactor/migrate-accessiblity-props-to-aria-props

Conversation

@MrMuzyk

@MrMuzyk MrMuzyk commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Motivation

React Native added aria-* props as web-compatible aliases for the legacy accessibility* props. This PR migrates the library's internal usage across all components to the modern API, so components work correctly with React Native Web and align with the direction RN is taking the accessibility API.

Changes

Mapping applied uniformly:

  • accessibilityLabelaria-label
  • accessibilityRolerole
  • accessibilityState={{ disabled }}aria-disabled
  • accessibilityState={{ selected }}aria-selected
  • accessibilityState={{ checked }}aria-checked
  • accessibilityState={{ expanded }}aria-expanded

TextInput additionally replaces accessibilityState: { disabled, invalid } with aria-disabled and aria-invalid. Because aria-invalid is not yet in RN's AccessibilityProps type (RN 0.85.3), GetAccessibilityDataReturn.input uses an intersection type AccessibilityProps & { 'aria-invalid'?: boolean }.

BREAKING CHANGE: aria-* props take precedence over accessibility* props in React Native when both are set on the same element. Consumers who pass accessibilityLabel, accessibilityRole, or accessibilityState to Paper components to override defaults will be silently ignored after this bump.

Related issue

N/A

Test plan

yarn typescript clean
yarn lint clean
yarn jest — 9 test files updated to query/assert on aria-* props instead of accessibilityState/accessibilityLabel; 28 snapshot files regenerated to reflect the prop rename in the render tree. Full suite passes.

@MrMuzyk MrMuzyk marked this pull request as ready for review June 22, 2026 08:33
MrMuzyk and others added 3 commits June 22, 2026 12:22
…ssiblity-props-to-aria-props

# Conflicts:
#	src/components/Appbar/AppbarContent.tsx
#	src/components/__tests__/Appbar/Appbar.test.tsx
#	src/components/__tests__/DataTable.test.tsx
#	src/components/__tests__/FAB.test.tsx
#	src/components/__tests__/FABExtended.test.tsx
#	src/components/__tests__/MenuItem.test.tsx
#	src/components/__tests__/ProgressBar.test.tsx
#	src/components/__tests__/Switch.test.tsx
#	src/components/__tests__/TextInput.test.tsx

@satya164 satya164 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@satya164 satya164 merged commit 466d9c6 into callstack:main Jun 23, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants